package com.itheima.Mapper;

import com.itheima.Pojo.Clazz;
import com.itheima.Pojo.ClazzQueryParam;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ClazzMapper {

    List<Clazz> list(ClazzQueryParam param);

    void deleteById(Integer id);

    @Insert("insert into clazz VALUES (null,#{name},#{room},#{beginDate},#{endDate},#{masterId}, #{subject},#{createTime},#{updateTime})")
    void insert(Clazz clazz);

    @Select("select * from clazz where id= #{id}")
    Clazz selectById(Integer id);

    //更新班级信息，更改的可能并不是全部因此要用动态sql
    void update(Clazz clazz);

    @Select("select * from clazz")
    List<Clazz> findAll();
}
